package We.src;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 杜家慧
 * @date 2021/9/23  16:42
 */
public class HelloWorldsdjhzerosevenzerosix {
    public static void main(String[] args) {
        //1
        System.out.println("Hello World!");
        //2
        for (int i = 0; i < 100; i++) {
            if (i % 2 == 0) {
                System.out.println("当前偶数" + i);
            }
        }

        // 3
       /* Map<Integer,String> map=new HashMap<Integer,String>();
        map.put(1,"九月二十二");
        map.put(2,"九月二十三");
        map.put(3,"九月二十四");
        for (int j = 1; j <=map.size() ; j++) {
           System.out.println("map的值为："+map.get(j));
        }
        for(Integer o : map.keySet()){
            System.out.println("key值" +o+" || value值："+map.get(o));
        }*/

        int[] arr = {1, 2, 3, 2, 4, 5, 7, 10, 1, 5, 3, 5, 8, 9, 4, 5, 2, 3};
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();

        for (int i = 0; i < arr.length; i++) {
            map.put(arr[i], arr[i]);
        }

        // 去重之后，map的(数值)总共有：
        System.out.println("map总共有数值" + map.size());
        for (Integer o : map.keySet()) {
            System.out.println("key 为" + o + "||" + "value为：" + map.get(o));
        }
    }
}
